
% Load data
x = readtable('Appendix_Figure_Data.xlsx','Sheet','Sheet1','Range','B2:H76');
y = readtable('Appendix_Figure_Data.xlsx','Sheet','Sheet2');
z = readtable('Appendix_Figure_Data.xlsx','Sheet','Sheet3');

t = datetime('1976-03-31')

dates3 = t + calmonths(3:3:226);
dates = dates3';

loans3 = table2array(x(:,1));
avg_rate3 = table2array(x(:,2));
year = table2array(x(:,3));
quarter = table2array(x(:,4));
rr = table2array(x(:,5));
ffr_end = table2array(x(:,6));
ffr_avg = table2array(x(:,7));
year2 = table2array(y(:,1));
share2 = table2array(y(:,2));
year3 = table2array(z(:,1));
sa_small_share2 = table2array(z(:,2));
sa_big_share2 = table2array(z(:,3));
bhc_small_share2 = table2array(z(:,4));
bhc_big_share2 = table2array(z(:,5));

% Figure A.1
figure
plot(dates,rr,'LineStyle','-','Color',[0.75 0 0],'LineWidth',2);
hold on 
plot(dates,ffr_end,'LineStyle','-','Color',[0 0 0.60],'LineWidth',1.5);
hold on
legend('RR', 'FFR')
title('Monetary Policy Indicators')
ylabel('Percentage Points')
xlabel('Year')
hold on
datetick


% Figure A.2
full_dates = [t;dates];
figure
hold on 
plot(year2,share2,'LineStyle','-','Color',[0 0 0.75],'LineWidth',1.5);
hold on
title('Commercial Bank Loan Share of Total Private Credit')
ylabel('Share')
xlabel('Year')


% Figure A.3
loans = loans3*100;
figure
hold on 
plot(dates,loans,'LineStyle','-','Color',[0 0 0.75],'LineWidth',1.5);
hold on
title('Average Real Loan Growth')
ylabel('Percentage Points')
xlabel('Year')
hold on
datetick

% Figure A.4
rates = avg_rate3*100;
figure
hold on 
plot(dates,rates,'LineStyle','-','Color',[0 0 0.75],'LineWidth',1.5);
hold on
title('Average Loan Rate')
ylabel('Percentage Points')
xlabel('Year')
hold on
datetick


% Figure A.5
figure
plot(year3,sa_small_share2,'LineStyle','-','Color',[1 0 0],'LineWidth',1.5);
hold on 
plot(year3,sa_big_share2,'LineStyle','-','Color',[0 0 1],'LineWidth',1.5);
hold on
plot(year3,bhc_small_share2,'LineStyle','-','Color',[0 1 0],'LineWidth',1.5);
hold on 
plot(year3,bhc_big_share2,'LineStyle','-','Color',[0 0 0],'LineWidth',1.5);
hold on
legend('Small Stand Alone', 'Large Stand Alone', 'Small BHC', 'Large BHC')
title('National Loan Share by Bank Type')
hold on

